//
//  MKViewController.m
//  MapleKit
//
//  Created by itzhaolei on 07/24/2019.
//  Copyright (c) 2019 itzhaolei. All rights reserved.
//

#import "MKViewController.h"
#import <MapleKit/MKTitleOptionsTrackBar.h>

@interface MKViewController ()

///标题跟踪条
@property (nonatomic,weak) MKTitleOptionsTrackBar *trackBar;

@end

@implementation MKViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = UIColor.blackColor;
    [self trackBar];
}

#pragma mark - Lazy
- (MKTitleOptionsTrackBar *)trackBar {
    if (!_trackBar) {
        MKTitleOptionsTrackBar *view = [[MKTitleOptionsTrackBar alloc] initWithFrame:CGRectMake(0, 50.0, UIScreen.mainScreen.bounds.size.width, 50.0)];
        view.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width * 1.5, 50.0);
        view.contentView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:1.0];
        
        view.titles = @[@"英雄",
                        @"英雄",
                        @"英雄",
                        @"英雄",
                        @"英剑",
                        @"英雄",
                        @"英雄"];
        
        view.action = ^(NSInteger index) {
        };
        
        view.selectIndex = 5;
        
        
        [self.view addSubview:view];
        _trackBar = view;
    }
    return _trackBar;
}

@end
